RegistryPolicy.WriteListOfValues Method (RegistryHive, String, String[], RegistryValueKind)
Writes a list of registry-based policy settings that configure String or ExpandString registry values. The registry values are specified by an array of value data. The policy settings are not additive.
Namespace: Microsoft.GroupPolicy
Assembly: Microsoft.GroupPolicy.Management (in Microsoft.GroupPolicy.Management.dll)
Syntax
public void WriteListOfValues(
RegistryHive hive,
string keyPath,
string[] values,
RegistryValueKind type
)
public:
void WriteListOfValues(
RegistryHive hive,
String^ keyPath,
array<String^>^ values,
RegistryValueKind type
)
member WriteListOfValues :
hive:RegistryHive *
keyPath:string *
values:string[] *
type:RegistryValueKind -> unit
Public Sub WriteListOfValues (
hive As RegistryHive,
keyPath As String,
values As String(),
type As RegistryValueKind
)
Parameters
hive
Type: Microsoft.Win32.RegistryHiveOne of the RegistryHive values that specifies the registry hive of the key. Specify CurrentUser to write policy settings to User Configuration. Specify LocalMachine to write policy settings to Computer Configuration. No other values are supported.
keyPath
Type: System.StringThe path to the registry key.
values
Type: System.String[]An array of strings that contains the value data.
type
Type: Microsoft.Win32.RegistryValueKindOne of the RegistryValueKind enumeration values that specifies the data type for the registry values. Only ExpandString and String are supported.
Exceptions
Exception | Condition |
---|---|
ObjectDisposedException | The RegistryPolicy is disposed. |
InvalidOperationException | The RegistryPolicy instance is read-only. |
ArgumentNullException | keyPath is null or values is null |
ArgumentException | keyPath is an empty string (“”) -or- values is an empty string (“”) -or- hive is not CurrentUser or LocalMachine -or- type is not ExpandString or String |
See Also
WriteListOfValues Overload
RegistryPolicy Class
Microsoft.GroupPolicy Namespace
Return to top